package com.ysd.qxgl.service;

import java.util.List;

import javax.annotation.Resource;

import com.ysd.qxgl.dao.IRolesDao;
import com.ysd.qxgl.dto.IRolesDTO;
import com.ysd.qxgl.model.Roles;

import org.springframework.stereotype.Service;
@Service
public class RolesServiceImpl implements IRolesService {
 @Resource
 private IRolesDao rolesDao;
    @Override
    public List<Roles> findAll(IRolesDTO dto) {
        return rolesDao.findAll(dto) ;
    }

    @Override
    public void addOrEdit(Roles role) {
       // 如果没有id,说明
       if (role.getId()!= null&&!"".equals(role.getId())) {
        rolesDao.edit(role);
    } else {
        rolesDao.add(role);
    }
}
    @Override
    public int del(String id) {
    return rolesDao.del(id);
    }

    @Override
    public int getCount(IRolesDTO dto) {
     return rolesDao.getCount(dto);
    }

    @Override
    public List<Roles> findTable() {
        return rolesDao.findTable();
    }

    @Override
    public List<Roles> findRoles(String userid) {
        return rolesDao.findRoles(userid);
    }

}